package com.qf.boot2203.aspect;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;


//@Aspect
//@Component
public class MyAspect {

    @Pointcut("execution(* com.qf.boot2203.controller..*.*(..))")
    public void controllerPointCut(){}

    @Before("controllerPointCut()")
    public void before(){
        System.out.println("aop before --------------->");
    }

    @Around("controllerPointCut()")
    public Object around(ProceedingJoinPoint pjp) throws Throwable {
        System.out.println("around -- before -- aop ");
        final Object proceed = pjp.proceed();
        System.out.println(proceed);
        System.out.println("around -- after -- aop");
        return proceed;
    }

    @After("controllerPointCut()")
    public void after(){
        System.out.println("!!!!!!!!");
    }
}
